package com.controller.account;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.service.account.AccountService;
import com.vo.account.Account;

@Controller
@RequestMapping("/listAccount.htm")
public class ListAccount {
	@Autowired
	private AccountService accountService;

	@RequestMapping(method = RequestMethod.GET)
	public String listAccounts(ModelMap model) throws Exception {
		List<Account> accounts = accountService.getAllAccounts();
		model.put("accounts", accounts);
		return "accountList";
	}

	

}
